package com.xahj.bd2104.spark.core;

import com.alibaba.fastjson.JSON;

import java.util.Random;

/**
 * Created with IntelliJ IDEA.
 * Author: Amos
 * E-mail: amos@amoscloud.com
 * Date: 2021/9/13
 * Time: 11:18
 * Description:
 */
public class JavaTest {
    public static void main(String[] args) throws Exception {
        String str = "{\n" +
                "    \"uid\":  \"4\",\n" +
                "    \"t\":  \"1559973929283\",\n" +
                "    \"md\":  \"Vivo-14\",\n" +
                "    \"eamil\":  \"QG5P5SUU@199.com\",\n" +
                "    \"mid\":  \"4\",\n" +
                "    \"nw\":  \"4G\",\n" +
                "    \"l\":  \"en\",\n" +
                "    \"ba\":  \"Vivo\",\n" +
                "    \"hw\":  \"640*1136\"\n" +
                "}";


        // 将Json格式的字符串  解析成对象
        Log log = JSON.parseObject(str, Log.class);

        // 将对象格式化为 Json格式的字符串
        String res = JSON.toJSONString(log);

        System.out.println(res);
    }
}
